package com.letfox.finance.controller.finance;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.letfox.common.model.ResultResponse;
import com.letfox.finance.controller.BaseController;
import com.letfox.finance.service.UUserFinIncomeService;

@Controller
@RequestMapping(value = "/frmUser")
public class UUserFinIncomeController extends BaseController{
	@Autowired
	private UUserFinIncomeService uUserFinIncomeService;
	
	@RequestMapping(value = "/selectFrmUser",method=RequestMethod.POST)
	@ResponseBody
	public ResultResponse selectFrmUser(@RequestParam String accountId){
		try {
			resultResponse=uUserFinIncomeService.selectFimUser(accountId);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			ResultResponse.getFailInstance(e);
		}
		return resultResponse;
	}
	
	@RequestMapping(value = "/addFrmUser",method=RequestMethod.POST)
	@ResponseBody
	public ResultResponse saveFrmUser(@RequestParam String accountId,@RequestParam String fimId){
		try {
			resultResponse=uUserFinIncomeService.selectFimUser(accountId);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			ResultResponse.getFailInstance(e);
		}
		return resultResponse;
	}


}
